package pro.cherish.knowledgeormmysql.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import pro.cherish.knowledgecmomon.constant.DateTimeConstant;

import java.time.LocalDateTime;

/**
 * @author 创建人：cherish
 * @version 版本号：V1.0
 * <p>
 * ***************************修订记录************************************
 * 2019-11-08 cherish 创建该类功能。
 * **********************************************************************
 * </p>
 * @ClassName 类名：Teacher
 * @Description 功能说明：
 * <p>
 * TODO
 * </p>
 * **********************************************************************
 * @date 创建日期： 2019-11-08 cherish
 */
@Data
@Builder
@Accessors(chain = true)
@TableName("teacher")
public class Teacher {
    @TableId
    private String id;

    @TableField("name")
    private String name;


    @TableField("age")
    private Integer age;

    @Version
    private Long  version;


    private String tenantId;

    @TableLogic
    private Integer delFlag;

    // @DateTimeFormat(pattern= DateTimeConstant.dateTimeFormatPattern)
    // @JsonFormat
    // @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    // @JsonSerialize(using = LocalDateTimeSerializer.class)
    @TableField( fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    // @DateTimeFormat(pattern= DateTimeConstant.dateTimeFormatPattern)
    // @JsonFormat
    // @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    // @JsonSerialize(using = LocalDateTimeSerializer.class)
    @TableField( fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime modifyTime;
}
